package com.fy.tt.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.ResultSet;


@Data
@NoArgsConstructor
@ToString
@Table(name = "bls_environment")
public class Environment {
    //    @ApiModelProperty(value = "语境表唯一标识")
//    @TableId(value = "id", type = IdType.AUTO)
    @Id
    @Column(name = "id")
    private Long id;

    //    @ApiModelProperty(value = "对应语境类型（band、organization、department）ID")
    @Column(name = "type_id")
    private Long typeId;

    //    @ApiModelProperty(value = "语境定义文本")
    @Column(name = "content")
    private String content;

    //    @ApiModelProperty(value = "1 band, 2 organization, 3 department")
    @Column(name = "type")
    private Long type;


    public Environment(ResultSet rs) {
        try {
            this.id = rs.getLong("id");
            this.typeId = rs.getLong("type_id");
            this.content = rs.getString("content");
            this.type = rs.getLong("type") ;
        }catch (Exception e){
            System.out.println(e.getCause());
        }
    }
}
